/*
 * @Description:
 * @Date: 2024-07-09 14:40:33
 * @LastEditTime: 2024-07-24 14:34:32
 */
import request from '@/config/axios'
import qs from 'qs'
//获取用户树形结构
export const getUserThree = async (params) => {
  return await request.get({
    url: '/system/role/all-role-user?' + qs.stringify(params, { arrayFormat: 'repeat' })
  })
}
//创建相册
export const createAlbum = async (data) => {
  return await request.post({ url: '/countryside/album/create', data })
}
//获取相册分页

export const getAlbumPage = async (params) => {
  return await request.get({
    url: '/countryside/album/page?' + qs.stringify(params, { arrayFormat: 'repeat' })
  })
}
//获取相册详情
export const getAlbum = async (id) => {
  return await request.get({ url: '/countryside/album/get?id=' + id })
}
//更新相册 updateReport

export const updateAlbum = async (data) => {
  return await request.put({ url: '/countryside/album/update', data })
}
///admin-api/countryside/album/delete

export const deleteAlbum = async (id) => {
  return await request.delete({ url: '/countryside/album/delete?id=' + id })
}

//删除相册 /admin-api/
export const deletePhoto = async (id) => {
  return await request.delete({ url: '/countryside/album-photo/delete?id=' + id })
}
///admin-api
//获取照片分页
export const getPhotoPage = async (params) => {
  return await request.get({ url: '/countryside/album-photo/page', params })
}
//
export const createPhotoListPage = async (formData) => {
  return await request.upload({ url: '/countryside/album-photo/create', data: formData })
}
///admin-api
export const deletePhotos = async (params) => {
  return await request.delete({
    url: '/countryside/album-photo/ids?' + qs.stringify(params, { arrayFormat: 'repeat' })
  })
}

export const updatePhoto = async (data) => {
  return await request.put({ url: '/countryside/album-photo/priority?id=' + data })
}
